home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_kdelibs.idb / usr / freeware / kde / include / ktabctl.h.z / ktabctl.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  3.1 KB  |  114 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 1997 Alexander Sanda (alex@darkstar.ping.at)
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.     Boston, MA 02111-1307, USA.
  18. */
  19. /*
  20.  * $Id: ktabctl.h,v 1.4 1998/06/16 21:23:15 hoss Exp $
  21.  *
  22.  * $Log: ktabctl.h,v $
  23.  * Revision 1.4  1998/06/16 21:23:15  hoss
  24.  * *** empty log message ***
  25.  *
  26.  * Revision 1.3  1997/10/16 11:15:54  torben
  27.  * Kalle: Copyright headers
  28.  * kdoctoolbar removed
  29.  *
  30.  * Revision 1.2  1997/07/24 21:06:08  kalle
  31.  * Kalle:
  32.  * KToolBar upgraded to newtoolbar 0.6
  33.  * KTreeList has rubberbanding now
  34.  * Patches for SGI
  35.  *
  36.  * Revision 1.1.1.1  1997/04/13 14:42:43  cvsuser
  37.  * Source imported
  38.  *
  39.  * Revision 1.1.1.1  1997/04/09 00:28:10  cvsuser
  40.  * Sources imported
  41.  *
  42.  * Revision 1.1  1997/03/15 22:40:57  kalle
  43.  * Initial revision
  44.  *
  45.  * Revision 1.2.2.1  1997/01/07 14:41:57  alex
  46.  * release 0.1
  47.  *
  48.  * Revision 1.2  1997/01/07 13:47:09  alex
  49.  * first working release
  50.  *
  51.  * Revision 1.1.1.1  1997/01/07 13:44:53  alex
  52.  * imported
  53.  *
  54.  */
  55.  
  56. #ifndef KTABCTL_H
  57. #define KTABCTL_H
  58.  
  59. #include "qwidget.h"
  60. #include "qtabbar.h"
  61. #include "qarray.h"
  62.  
  63. /// KTabCtl, simple widget for the creation of tabbed window layouts.
  64. /** KTabCtl is very similar to QTabDialog, with the following differences:
  65.  To avoid confusion, the API is almost identical with QTabDialog.
  66.   
  67.   * does not create any button, therefore KTabCtl is not limited to dialog
  68.     boxes. You can use it whereever you want.
  69.      
  70.  * emits the signal tabSelected(int pagenumber) when the user selects one
  71.    of the tabs. This gives you the chance to update the widget contents
  72.  of a single page. The signal is emitted _before_ the page is shown.
  73.    Very important, if the contents of some widgets on page <a> depend on
  74.      the contents of some other widgets on page <b>.
  75. */
  76. class KTabCtl : public QWidget
  77. {
  78.     Q_OBJECT
  79.  
  80. public:
  81.     KTabCtl(QWidget *parent = 0, const char *name = 0);
  82.    ~KTabCtl();
  83.  
  84.     void show();
  85.     void setFont(const QFont & font);
  86.     void setTabFont( const QFont &font );
  87.  
  88.     void addTab(QWidget *, const char *);
  89.     bool isTabEnabled(const char * );
  90.     void setTabEnabled(const char *, bool);
  91.     void setBorder(bool);
  92.     void setShape( QTabBar::Shape shape );
  93.  
  94. protected:
  95.     void paintEvent(QPaintEvent *);
  96.     void resizeEvent(QResizeEvent *);
  97.  
  98. signals:
  99.     void tabSelected(int);
  100.     
  101. private slots:
  102.     void showTab(int i);
  103.  
  104. private:
  105.     void setSizes();
  106.     QRect getChildRect() const;
  107.  
  108.     QTabBar * tabs;
  109.     QArrayT<QWidget *> pages;
  110.     int bh;
  111.     bool blBorder;
  112. };
  113. #endif
  114.